(global.webpackJsonp = global.webpackJsonp || []).push([ [ "components/diyform/diyform" ], {
    "242b": function(t, e, n) {
        (function(l) {
            Object.defineProperty(e, "__esModule", {
                value: !0
            }), e.default = void 0;
            var t = {
                name: "diyform",
                props: [ "diyform", "siteroot", "formdescs", "newSessionKey", "zhixin", "pd_val", "formid" ],
                data: function() {
                    return {
                        $host: this.$host,
                        diy_host: this.$diyHost,
                        ttcxs: 0,
                        xuanz: -1,
                        lixuanz: -1,
                        xx: [],
                        formindex: -1,
                        arrs: [],
                        isover: 0,
                        myname: "",
                        mytel: "",
                        myadd: "",
                        wxmobile: "",
                        needAuth: !1,
                        needBind: !1,
                        forminfo: []
                    };
                },
                created: function(t) {
                    this.getFormInfo();
                },
                methods: {
                    getFormInfo: function() {
                        var e = this, t = l.getStorageSync("form_source");
                        l.request({
                            url: e.$host + "/api/Plugin/feedback",
                            data: {
                                uniacid: e.$uniacid,
                                sourceid: t || 0
                            },
                            success: function(t) {
                                e.forminfo = t.data.data.forminfo.tp_text;
                            }
                        });
                    },
                    bindInputChange: function(t) {
                        var e = t.detail.value, n = t.currentTarget.dataset.index, a = this.forminfo;
                        a[n].val = e, this.forminfo = a;
                    },
                    weixinadd: function() {
                        var r = this;
                        l.chooseAddress({
                            success: function(t) {
                                for (var e = t.provinceName + " " + t.cityName + " " + t.countyName + " " + t.detailInfo, n = t.userName, a = t.telNumber, i = r.forminfo, o = 0; o < i.length; o++) 0 == i[o].type && 2 == i[o].tp_text[0].yval && (i[o].val = n), 
                                0 == i[o].type && 3 == i[o].tp_text[0].yval && (i[o].val = a), 0 == i[o].type && 4 == i[o].tp_text[0].yval && (i[o].val = e);
                                r.myname = n, r.mytel = a, r.myadd = e, r.forminfo = i;
                            }
                        });
                    },
                    getPhoneNumber: function(t) {
                        var a = this, e = t.detail.iv, n = t.detail.encryptedData;
                        "getPhoneNumber:ok" == t.detail.errMsg ? l.checkSession({
                            success: function() {
                                l.request({
                                    url: a.$baseurl + "doPagejiemiNew",
                                    data: {
                                        uniacid: a.$uniacid,
                                        newSessionKey: a.newSessionKey,
                                        iv: e,
                                        encryptedData: n
                                    },
                                    success: function(t) {
                                        if (t.data.data) {
                                            for (var e = a.forminfo, n = 0; n < e.length; n++) 0 == e[n].type && 5 == e[n].tp_text[0].yval && (e[n].val = t.data.data);
                                            a.wxmobile = t.data.data, a.forminfo = e;
                                        } else l.showModal({
                                            title: "提示",
                                            content: "sessionKey已过期，请下拉刷新！"
                                        });
                                    },
                                    fail: function(t) {
                                        console.log(t);
                                    }
                                });
                            },
                            fail: function() {
                                l.showModal({
                                    title: "提示",
                                    content: "sessionKey已过期，请下拉刷新！"
                                });
                            }
                        }) : l.showModal({
                            title: "提示",
                            content: "请先授权获取您的手机号！",
                            showCancel: !1
                        });
                    },
                    checkboxChange: function(t) {
                        var e = t.detail.value, n = t.currentTarget.dataset.index, a = this.forminfo;
                        a[n].val = e, this.forminfo = a;
                    },
                    radioChange: function(t) {
                        var e = t.detail.value, n = t.currentTarget.dataset.index, a = this.forminfo;
                        a[n].val = e, this.forminfo = a;
                    },
                    delimg: function(t) {
                        var e = t.currentTarget.dataset.index, n = t.currentTarget.dataset.id, a = this.forminfo, i = a[e].z_val;
                        i.splice(n, 1), 0 == i.length && (i = []), a[e].z_val = i, this.forminfo = a, console.log(a[e].z_val);
                    },
                    choiceimg: function(t) {
                        var o = this, e = 0, r = o.zhixin, s = t.currentTarget.dataset.index, d = o.forminfo, n = d[s].val, a = d[s].tp_text[0];
                        n ? e = n.length : (e = 0, n = []);
                        var i = a - e;
                        o.pd_val, l.chooseImage({
                            count: i,
                            sizeType: [ "original", "compressed" ],
                            sourceType: [ "album", "camera" ],
                            success: function(t) {
                                r = !0, o.zhixin = r, l.showLoading({
                                    title: "图片上传中"
                                });
                                var n = t.tempFilePaths, a = 0, i = n.length;
                                !function e() {
                                    l.uploadFile({
                                        url: o.$baseurl + "wxupimg",
                                        formData: {
                                            uniacid: o.$uniacid
                                        },
                                        filePath: n[a],
                                        name: "file",
                                        success: function(t) {
                                            console.log(d[s].z_val), d[s].z_val.push(t.data), o.forminfo = d, ++a < i ? e() : (r = !1, 
                                            o.zhixin = r, l.hideLoading());
                                        }
                                    });
                                }();
                            }
                        });
                    },
                    bindPickerChange: function(t) {
                        console.log(t);
                        var e = t.detail.value, n = t.currentTarget.dataset.index, a = this.forminfo, i = a[n].tp_text[e];
                        a[n].val = i, this.forminfo = a;
                    },
                    bindDateChange: function(t) {
                        var e = t.detail.value, n = t.currentTarget.dataset.index, a = this.forminfo;
                        a[n].val = e, this.forminfo = a;
                    },
                    bindTimeChange: function(t) {
                        var e = t.detail.value, n = t.currentTarget.dataset.index, a = this.forminfo;
                        a[n].val = e, this.forminfo = a;
                    },
                    namexz: function(t) {
                        for (var e = this, n = t.currentTarget.dataset.index, a = e.forminfo[n], i = [], o = 0; o < a.tp_text.length; o++) {
                            var r = {};
                            r.keys = a.tp_text[o], r.val = 1, i.push(r);
                        }
                        e.ttcxs = 1, e.formindex = n, e.xx = i, e.xuanz = 0, e.lixuanz = -1, e.riqi();
                    },
                    riqi: function() {
                        for (var t = this, e = new Date(), n = new Date(e.getTime()), a = n.getFullYear() + "-" + (n.getMonth() + 1) + "-" + n.getDate(), i = t.xx, o = 0; o < i.length; o++) i[o].val = 1;
                        t.xx = i, t.gettoday(a);
                        for (var r = [], s = [], d = new Date(), l = 0; l < 5; l++) {
                            var u = new Date(d.getTime() + 24 * l * 3600 * 1e3), c = u.getFullYear(), f = u.getMonth() + 1, h = u.getDate(), m = f + "月" + h + "日", v = c + "-" + f + "-" + h;
                            r.push(m), s.push(v);
                        }
                        t.arrs = r, t.fallarrs = s, t.today = a;
                    },
                    gettoday: function(t) {
                        var i = this, e = i.formindex, o = i.xx;
                        l.request({
                            url: i.$baseurl + "dopageDuzhan",
                            data: {
                                uniacid: i.$uniacid,
                                id: 0,
                                types: "diy",
                                days: t,
                                pagedatekey: e
                            },
                            success: function(t) {
                                for (var e = t.data.data, n = 0; n < e.length; n++) o[e[n]].val = 2;
                                var a = 0;
                                e.length == o.length && (a = 1), i.xx = o, i.isover = a;
                            }
                        });
                    },
                    goux: function(t) {
                        this.lixuanz = t.currentTarget.dataset.index;
                    },
                    xuanzd: function(t) {
                        for (var e = t.currentTarget.dataset.index, n = this.fallarrs[e], a = this.xx, i = 0; i < a.length; i++) a[i].val = 1;
                        this.xuanz = e, this.today = n, this.lixuanz = -1, this.xx = a, this.gettoday(n);
                    },
                    quxiao: function() {
                        this.ttcxs = 0;
                    },
                    save_nb: function() {
                        var t = this.today, e = this.xx, n = this.lixuanz;
                        if (-1 == n) return l.showModal({
                            title: "提现",
                            content: "请选择预约的选项",
                            showCancel: !1
                        }), !1;
                        var a = "已选择" + t + "，" + e[n].keys.yval, i = this.forminfo, o = this.formindex;
                        i[o].val = a, i[o].days = t, i[o].indexkey = o, i[o].xuanx = n, this.ttcxs = 0, 
                        this.forminfo = i;
                    },
                    diyFormSubmit: function(t) {
                        if (!this.getSuid()) return !1;
                        for (var e = this.forminfo, n = 0; n < e.length; n++) {
                            if (1 == e[n].ismust) if (5 == e[n].type) {
                                if (!e[n].z_val) return l.showModal({
                                    title: "提醒",
                                    content: e[n].name + "为必填项！",
                                    showCancel: !1
                                }), !1;
                            } else {
                                if ("" == e[n].val) return l.showModal({
                                    title: "提醒",
                                    content: e[n].name + "为必填项！",
                                    showCancel: !1
                                }), !1;
                                if (0 == e[n].type && 1 == e[n].tp_text[0].yval) {
                                    if (!/^1[3456789]{1}\d{9}$/.test(e[n].val)) return l.showModal({
                                        title: "提醒",
                                        content: "请您输入正确的手机号码",
                                        showCancel: !1
                                    }), !1;
                                } else if (0 == e[n].type && 7 == e[n].tp_text[0].yval) {
                                    if (!/^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(e[n].val)) return l.showModal({
                                        title: "提醒",
                                        content: "请您输入正确的身份证号",
                                        showCancel: !1
                                    }), !1;
                                }
                            }
                            if (5 == e[n].type && e[n].z_val && 0 < e[n].z_val.length) for (var a = 0; a < e[n].z_val.length; a++) e[n].z_val[a] = e[n].z_val[a].substr(e[n].z_val[a].indexOf("/upimages"));
                        }
                        var i = l.getStorageSync("openid");
                        l.request({
                            url: this.$baseurl + "doPageDiyForms",
                            data: {
                                uniacid: this.$uniacid,
                                suid: l.getStorageSync("suid"),
                                forminfo: JSON.stringify(e),
                                formid: this.formid,
                                openid: i,
                                source: l.getStorageSync("source"),
                                form_id: t.detail.formId ? t.detail.formId : ""
                            },
                            success: function(t) {
                                1 == t.data.data ? l.showModal({
                                    title: "提醒",
                                    content: "表单提交成功",
                                    showCancel: !1,
                                    success: function() {
                                        l.reLaunch({
                                            url: "/pages/index/index"
                                        });
                                    }
                                }) : l.showModal({
                                    title: "提醒",
                                    content: "表单提交成功, 邮件发送失败",
                                    showCancel: !1,
                                    success: function() {}
                                });
                            }
                        });
                    },
                    cell: function() {
                        this.needAuth = !1;
                    },
                    closeAuth: function() {
                        this.needAuth = !1, this.needBind = !0;
                    },
                    closeBind: function() {
                        this.needBind = !1;
                    },
                    getSuid: function() {
                        if (l.getStorageSync("suid")) return !0;
                        return l.getStorageSync("golobeuser") ? this.needBind = !0 : this.needAuth = !0, 
                        !1;
                    }
                }
            };
            e.default = t;
        }).call(this, n("543d").default);
    },
    "468a": function(t, e, n) {
        n.r(e);
        var a = n("242b"), i = n.n(a);
        for (var o in a) "default" !== o && function(t) {
            n.d(e, t, function() {
                return a[t];
            });
        }(o);
        e.default = i.a;
    },
    "72e3": function(t, e, n) {},
    b16e: function(t, e, n) {
        n.r(e);
        var a = n("d076"), i = n("468a");
        for (var o in i) "default" !== o && function(t) {
            n.d(e, t, function() {
                return i[t];
            });
        }(o);
        n("c67e");
        var r = n("2877"), s = Object(r.a)(i.default, a.a, a.b, !1, null, null, null);
        e.default = s.exports;
    },
    c67e: function(t, e, n) {
        var a = n("72e3");
        n.n(a).a;
    },
    d076: function(t, e, n) {
        var a = function() {
            this.$createElement;
            this._self._c;
        }, i = [];
        n.d(e, "a", function() {
            return a;
        }), n.d(e, "b", function() {
            return i;
        });
    }
} ]), (global.webpackJsonp = global.webpackJsonp || []).push([ "components/diyform/diyform-create-component", {
    "components/diyform/diyform-create-component": function(t, e, n) {
        n("543d").createComponent(n("b16e"));
    }
}, [ [ "components/diyform/diyform-create-component" ] ] ]);